@using Fyp.Models;
@{
    Layout = "~/Shared/_layoutPage.cshtml";
    string s = "c";
    List<SelectListItem> items = new List<SelectListItem>();
    items.Add(new SelectListItem
    {
        Text = "Select Task Type",
        Value = "0",
        Selected = true
    });
    items.Add(new SelectListItem
    {
        Text = "Assigned",
        Value = "Assigned",
    });
    items.Add(new SelectListItem
    {
        Text = "By Self",
        Value = "By Self"
    });
    var PageTitle = "Submit Daily Task";
    string t = "Task ";
    string com = "comnt";
    int i;
}
@section title
{
    @PageTitle;
}        
<html>
<head>
<link rel="stylesheet" type="text/css" href="~/Styles/template.css" media="screen">
<style type="text/css">
#SubmitTaskMainDiv 
{
    background-color: azure;
    width:950px;
    margin-left:5px;
    height:auto;
}
#SubmitTaskMainDiv #SubmitTaskForm 
{
    margin-top:0px;
    margin-left:117px;
    height:auto;
    margin-bottom:0px;
}
#SubmitTaskMainDiv #SubmitTaskForm p 
{
    margin-top:0px;
    margin-left:1px;
}
#SubmitTaskMainDiv #SubmitTaskForm #DropDownList1 
{
    margin-top:80px;
    margin-left:-655px;
}
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskAssignedDiv  
{
    width:880px;
    margin-left:-51px;
    background-color: azure;
    height:auto;
}     
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskAssignedDiv #SubmitTaskTableAssigned
{ 
    margin-left:53px;
    margin-top:-28px;
}
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskAssignedDiv  td
{
    width:60px;
    text-align:center;
    height:20px;
    border:1px solid green; 
    padding:2px;    
}  
#SubmitTaskMainDiv  #SubmitTaskForm #SubmitTaskAssignedDiv #SubmitTaskTableAssigned td textarea
{
      height:90px;
      width:235px;
}
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskSelfDiv
{   
    margin-left:-50px;
    height:273px;
    width:100px;
}
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskSelfDiv #SubmitTaskTableSelf 
{
    margin-left:50px;
    margin-top:-5px;
    text-align:left;
    height:100px;
    width:600px;
}
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskSelfDiv #SubmitTaskTableSelf td 
{
    text-align:left;
    height:50px;
    width:90px;
}  
#SubmitTaskMainDiv #SubmitTaskForm #SubmitTaskSelfDiv  #SubmitTaskTableSelf td textarea
{
      height:80px;
      width:289px;
}
#SubmitTaskMainDiv #SubmitTaskSelfForm #SubmitTaskSelfDiv input#submitbtn
{
    margin-left:40px;
    margin-top:-80px;
}
#SubmitTaskMainDiv #SubmitTaskSelfForm #SubmitTaskSelfDiv input#cancelbtn 
{
    margin-left:2px;
    margin-top:-80px;
}
th 
{
    background-color:green;
    color:white;
    padding:2px;
    border:1px solid green; 
}
</style>
<script src="/Scripts/jquery-1.8.2.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui.js" type="text/javascript"></script>
<link rel="stylesheet" href="/Styles/jquery-ui.css" />
<link href="../../Styles/jquery.ambiance.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery.ambiance.js" type="text/javascript"></script>
<link rel="stylesheet" href="/Styles/jquery.timeentry.css" />
<script type="text/javascript" src="/Scripts/jquery.timeentry.js"></script>
<script>
    $(document).ready(function () {
        $('#SubmitTaskAssignedDiv').show();
        $('#SubmitTaskSelfDiv').hide();
        
        $("#DropDownList1").change(function () {
            var text = $("#DropDownList1 option:selected").text();
            if ($("#DropDownList1 option:selected").val() =="Assigned") {
                @*alert($(this).val());*@
                $('#SubmitTaskAssignedDiv').show();
                $('#SubmitTaskSelfDiv').hide();}
            if ($("#DropDownList1 option:selected").val() == "By Self")    {
                @*alert($(this).val());*@
                $('#SubmitTaskAssignedDiv').hide();
                $('#SubmitTaskSelfDiv').show();   
          }
        });
        $("#cancelbtn").click(function () {
            $.ambiance({
                message: "Cancel Submission!",
                type: "error",
                fade: false
            });
        });
        $('#Assignedstarttime').timeEntry({ show24Hours: false, showSeconds: false, ampmNames: ['AM', 'PM'] });
        $('#Assignedendtime').timeEntry({ show24Hours: false, showSeconds: false, ampmNames: ['AM', 'PM'] });
    });
</script>
</head>
<body>
<div id="SubmitTaskMainDiv">
<div id="content" style="margin-left: 98px;margin-bottom: -1px;">
    <h2 style="text-align: center;"><b>Submit Task</b></h2><br/></div>
@using (Html.BeginForm("SubmitTask", "SubmitDailyTask", FormMethod.Post, new {enctype = "multipart/form-data", @id = "SubmitTaskForm" }))
{
@Html.DropDownList("DropDownList1", items)    
<br/><br/>
<p>Time In: <input type="text" id="Assignedstarttime"  />Time Out: <input type="text" id="Assignedendtime"  /></p>
<div id="SubmitTaskAssignedDiv">      
<br/><br/>  
<table id="SubmitTaskTableAssigned" border="1">
       <thead>
       <tr>
       <th>Select</th>
       <th>Task</th>
       <th>Type</th>
       <th>Attach</th>
       <th>Comment</th>
       <th>Status</th>
       </tr>
       </thead>
       <tbody>
       @for (i = 0; i < global.indtasklst.Count(); i++)
       {
           string v = @s + i;
           string ct = @com + i;
           <tr>
               <td><input type="checkbox" id="@v" name="@v"/></td>
               <td>@t@global.indtasklst[i].TId</td>
               <td><label >Individual</label></td>
               <td><input type="file" name="file"  style="margin-left:55px"/></td>
               <td><textarea rows="0" cols="20"  name="@ct"></textarea></td>
               <td>@global.indtasklst[i].Status</td>
           </tr>
       }
       @for (int j = 0; j < global.grptasklst.Count(); j++)
       {
           string k = @s + i;
           string ctt = @com + i;
           <tr>
               <td><input type="checkbox" id="@k" name="@k"/></td>
               <td>@t@global.grptasklst[j].TId</td>
               <td><label>Group</label></td>
               <td><input type="file" name="file" style="margin-left:55px"/></td>
               <td><textarea rows="0" cols="20" name="@ctt"></textarea></td>
               <td>@global.grptasklst[j].Status</td> 
           </tr>
           i++; 
       }
       </tbody>
 </table>
 <br/><br/>
</div>
<div id="SubmitTaskSelfDiv">
<br/>   
<table id="SubmitTaskTableSelf">
<tbody>
<tr>
<td><label id="lbld">Task Description</label></td>
<td><textarea rows="0" cols="20" name="tdescription"></textarea></td>
</tr>
<tr>
<td><br/><label id="lblc">Comments</label></td>
<td><br/><textarea rows="0" cols="20" name="tcomment"></textarea></td>
</tr>
<tr>
<td><label id="lbla">Attach Task</label></td>
<td><input type="file" name="Attach" /></td>
</tr>
</tbody>
</table>
</div>
<input type="Submit" value="SubmitTask" class="buttonSave" id="submitbtn" name="button" style="margin-left:0px;" />
<input type="button" value="Cancel" class ="buttonCancel" id="cancelbtn"/>
}
</div>
</body>
</html>


